import request from "../../../utils/request";

Page({
    data: {},

    handleLogin() {
        wx.login({
            success: (res) => {
                if (res.code) {
                    this.handleGetOpenId(res.code);
                } else {
                    console.log('登录失败！' + res.errMsg)
                }
            }
        })
    },

    async handleGetOpenId(code) {
        const res = await request('/getOpenId', {code});
        const token = res.data.token;
        console.log(token);
    }
});
